import { createWebHistory, createRouter } from 'vue-router'

// 导入页面组件
import Home from '@/views/Home.vue'
import ArticleEdit from '@/views/ArticleEdit.vue'
import UserProfile from '@/views/UserProfile.vue'
import ArticleDetail from '@/views/ArticleDetail.vue'
import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/', component: Home, name: 'Home' },
    { path: '/article/edit', component: ArticleEdit, name: 'ArticleEdit' },
    { path: '/user/profile', component: UserProfile, name: 'UserProfile' },
    { path: '/article/:id', component: ArticleDetail, name: 'ArticleDetail' },
    { path: '/login', component: Login, name: 'Login' },
    { path: '/register', component: Register, name: 'Register' }
    // 可以添加更多路由规则
  ]
})

export default router
